package org.cms.config;

import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Contact;
import io.swagger.v3.oas.models.info.Info;
import io.swagger.v3.oas.models.info.License;
import org.springdoc.core.models.GroupedOpenApi;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class Knife4jConfig {

    @Bean
    public OpenAPI customOpenAPI() {
        return new OpenAPI()
                .info(new Info()
                        .title("cms")
                        .description("description")
                        .version("1.0.0")
                        .contact(new Contact()
                                .name("kh")
                                .url("url")
                                .email("3339607643qq.com"))
                        .license(new License()
                                .name("MIT License"))
                );
    }

    @Bean
    public GroupedOpenApi publicApi() {
        return GroupedOpenApi.builder()
                .group("cms-api")
                .packagesToScan("org.cms.feature")
                .pathsToExclude("/api/**")
                .build();
    }
}



